package org.ugt.android5in1;

import org.ugt.android5in1.cont.Controler;
import org.ugt.android5in1.service.GameService;
import org.ugt.android5in1.view.GameView;
import android.app.Activity;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;

public class Android5in1Activity extends Activity {
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		GameView gv = (GameView) findViewById(R.id.gameView);
		GameService gs = new GameService(10);
		final Controler cont = new Controler();
		cont.setGv(gv);
		cont.setServ(gs);
		cont.link();
		gv.setOnTouchListener(new OnTouchListener() {

			@Override
			public boolean onTouch(View v, MotionEvent event) {
				// TODO Auto-generated method stub
				int x = (int) event.getX();
				int y = (int) event.getY();
				cont.doclick(x, y);
				return false;
			}
		});

	}
}